#include <iostream>
#include <vector>
#include <queue>

using namespace std;

const int N = 4;

int a[][2] = {{3, 2},
    {0, 1},
    {1, 2}};

int indegree[N];
vector<int> edge[4];
queue<int> q;

int cnt = 0;

void topsort()
{
    for (int i = 0; i < N; ++i)
    {
        indegree[i] = 0;
    }
    for (int i = 0; i < 3; ++i)
    {
        indegree[a[i][1]]++;
        edge[a[i][0]].push_back(a[i][1]);
    }

    for (int i = 0; i < N; ++i)
    {
        if(0 == indegree[i])
        {
            q.push(i);
        }
    }

    while (!q.empty())
    {
        int t = q.front();
        q.pop();
        cnt++;

        for (int i = 0; i < edge[t].size(); ++i)
        {
            --indegree[edge[t][i]];
            if (0 == indegree[edge[t][i]])
            {
                q.push(edge[t][i]);
            }
        }
    }

    if (cnt == 4)
    {
        cout << "yes" << endl;
    }
    else
    {
        cout << "no" << endl;
    }
}

int main()
{
    topsort();
    return 0;
}
